﻿#if USE_UNI_LUA
using LuaAPI = UniLua.Lua;
using RealStatePtr = UniLua.ILuaState;
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
#else
using LuaAPI = XLua.LuaDLL.Lua;
using RealStatePtr = System.IntPtr;
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
#endif

using XLua;
using System.Collections.Generic;


namespace XLua.CSObjectWrap
{
    using Utils = XLua.Utils;
    public class UnityEngineProfilingMemoryExperimentalMemoryProfilerWrap 
    {
        public static void __Register(RealStatePtr L)
        {
			ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			System.Type type = typeof(UnityEngine.Profiling.Memory.Experimental.MemoryProfiler);
			Utils.BeginObjectRegister(type, L, translator, 0, 0, 0, 0);
			
			
			
			
			
			
			Utils.EndObjectRegister(type, L, translator, null, null,
			    null, null, null);

		    Utils.BeginClassRegister(type, L, __CreateInstance, 4, 0, 0);
			Utils.RegisterFunc(L, Utils.CLS_IDX, "TakeSnapshot", _m_TakeSnapshot_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "TakeTempSnapshot", _m_TakeTempSnapshot_xlua_st_);
            
			Utils.RegisterFunc(L, Utils.CLS_IDX, "createMetaData", _e_createMetaData);
			
            
			
			
			
			Utils.EndClassRegister(type, L, translator);
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __CreateInstance(RealStatePtr L)
        {
            
			try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
				if(LuaAPI.lua_gettop(L) == 1)
				{
					
					var gen_ret = new UnityEngine.Profiling.Memory.Experimental.MemoryProfiler();
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				
			}
			catch(System.Exception gen_e) {
				return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
			}
            return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Profiling.Memory.Experimental.MemoryProfiler constructor!");
            
        }
        
		
        
		
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_TakeSnapshot_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
			    int gen_param_count = LuaAPI.lua_gettop(L);
            
                if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)&& translator.Assignable<System.Action<string, bool>>(L, 2)&& translator.Assignable<UnityEngine.Profiling.Memory.Experimental.CaptureFlags>(L, 3)) 
                {
                    string _path = LuaAPI.lua_tostring(L, 1);
                    System.Action<string, bool> _finishCallback = translator.GetDelegate<System.Action<string, bool>>(L, 2);
                    UnityEngine.Profiling.Memory.Experimental.CaptureFlags _captureFlags;translator.Get(L, 3, out _captureFlags);
                    
                    UnityEngine.Profiling.Memory.Experimental.MemoryProfiler.TakeSnapshot( _path, _finishCallback, _captureFlags );
                    
                    
                    
                    return 0;
                }
                if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)&& translator.Assignable<System.Action<string, bool>>(L, 2)) 
                {
                    string _path = LuaAPI.lua_tostring(L, 1);
                    System.Action<string, bool> _finishCallback = translator.GetDelegate<System.Action<string, bool>>(L, 2);
                    
                    UnityEngine.Profiling.Memory.Experimental.MemoryProfiler.TakeSnapshot( _path, _finishCallback );
                    
                    
                    
                    return 0;
                }
                if(gen_param_count == 4&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)&& translator.Assignable<System.Action<string, bool>>(L, 2)&& translator.Assignable<System.Action<string, bool, UnityEngine.Profiling.Experimental.DebugScreenCapture>>(L, 3)&& translator.Assignable<UnityEngine.Profiling.Memory.Experimental.CaptureFlags>(L, 4)) 
                {
                    string _path = LuaAPI.lua_tostring(L, 1);
                    System.Action<string, bool> _finishCallback = translator.GetDelegate<System.Action<string, bool>>(L, 2);
                    System.Action<string, bool, UnityEngine.Profiling.Experimental.DebugScreenCapture> _screenshotCallback = translator.GetDelegate<System.Action<string, bool, UnityEngine.Profiling.Experimental.DebugScreenCapture>>(L, 3);
                    UnityEngine.Profiling.Memory.Experimental.CaptureFlags _captureFlags;translator.Get(L, 4, out _captureFlags);
                    
                    UnityEngine.Profiling.Memory.Experimental.MemoryProfiler.TakeSnapshot( _path, _finishCallback, _screenshotCallback, _captureFlags );
                    
                    
                    
                    return 0;
                }
                if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)&& translator.Assignable<System.Action<string, bool>>(L, 2)&& translator.Assignable<System.Action<string, bool, UnityEngine.Profiling.Experimental.DebugScreenCapture>>(L, 3)) 
                {
                    string _path = LuaAPI.lua_tostring(L, 1);
                    System.Action<string, bool> _finishCallback = translator.GetDelegate<System.Action<string, bool>>(L, 2);
                    System.Action<string, bool, UnityEngine.Profiling.Experimental.DebugScreenCapture> _screenshotCallback = translator.GetDelegate<System.Action<string, bool, UnityEngine.Profiling.Experimental.DebugScreenCapture>>(L, 3);
                    
                    UnityEngine.Profiling.Memory.Experimental.MemoryProfiler.TakeSnapshot( _path, _finishCallback, _screenshotCallback );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
            return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Profiling.Memory.Experimental.MemoryProfiler.TakeSnapshot!");
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_TakeTempSnapshot_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
			    int gen_param_count = LuaAPI.lua_gettop(L);
            
                if(gen_param_count == 2&& translator.Assignable<System.Action<string, bool>>(L, 1)&& translator.Assignable<UnityEngine.Profiling.Memory.Experimental.CaptureFlags>(L, 2)) 
                {
                    System.Action<string, bool> _finishCallback = translator.GetDelegate<System.Action<string, bool>>(L, 1);
                    UnityEngine.Profiling.Memory.Experimental.CaptureFlags _captureFlags;translator.Get(L, 2, out _captureFlags);
                    
                    UnityEngine.Profiling.Memory.Experimental.MemoryProfiler.TakeTempSnapshot( _finishCallback, _captureFlags );
                    
                    
                    
                    return 0;
                }
                if(gen_param_count == 1&& translator.Assignable<System.Action<string, bool>>(L, 1)) 
                {
                    System.Action<string, bool> _finishCallback = translator.GetDelegate<System.Action<string, bool>>(L, 1);
                    
                    UnityEngine.Profiling.Memory.Experimental.MemoryProfiler.TakeTempSnapshot( _finishCallback );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
            return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Profiling.Memory.Experimental.MemoryProfiler.TakeTempSnapshot!");
            
        }
        
        
        
        
        
        
		
		
		
		
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _e_createMetaData(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			    int gen_param_count = LuaAPI.lua_gettop(L);
                System.Action<UnityEngine.Profiling.Memory.Experimental.MetaData> gen_delegate = translator.GetDelegate<System.Action<UnityEngine.Profiling.Memory.Experimental.MetaData>>(L, 2);
                if (gen_delegate == null) {
                    return LuaAPI.luaL_error(L, "#2 need System.Action<UnityEngine.Profiling.Memory.Experimental.MetaData>!");
                }
                
				
				if (gen_param_count == 2 && LuaAPI.xlua_is_eq_str(L, 1, "+")) {
					UnityEngine.Profiling.Memory.Experimental.MemoryProfiler.createMetaData += gen_delegate;
					return 0;
				} 
				
				
				if (gen_param_count == 2 && LuaAPI.xlua_is_eq_str(L, 1, "-")) {
					UnityEngine.Profiling.Memory.Experimental.MemoryProfiler.createMetaData -= gen_delegate;
					return 0;
				} 
				
			} catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
			return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Profiling.Memory.Experimental.MemoryProfiler.createMetaData!");
        }
        
    }
}
